package com.ruoyi.hospital.service.order.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.hospital.mapper.order.ShopOrderAfterMapper;
import com.ruoyi.hospital.domain.order.ShopOrderAfter;
import com.ruoyi.hospital.service.order.IShopOrderAfterService;

/**
 * 售后订单Service业务层处理
 * 
 * @author wendao
 * @date 2024-09-14
 */
@Service
public class ShopOrderAfterServiceImpl implements IShopOrderAfterService 
{
    @Autowired
    private ShopOrderAfterMapper shopOrderAfterMapper;

    /**
     * 查询售后订单
     * 
     * @param id 售后订单主键
     * @return 售后订单
     */
    @Override
    public ShopOrderAfter selectShopOrderAfterById(Long id)
    {
        return shopOrderAfterMapper.selectShopOrderAfterById(id);
    }

    /**
     * 查询售后订单列表
     * 
     * @param shopOrderAfter 售后订单
     * @return 售后订单
     */
    @Override
    public List<ShopOrderAfter> selectShopOrderAfterList(ShopOrderAfter shopOrderAfter)
    {
        return shopOrderAfterMapper.selectShopOrderAfterList(shopOrderAfter);
    }

    /**
     * 新增售后订单
     * 
     * @param shopOrderAfter 售后订单
     * @return 结果
     */
    @Override
    public int insertShopOrderAfter(ShopOrderAfter shopOrderAfter)
    {
        shopOrderAfter.setCreateTime(DateUtils.getNowTimeSecond());
        return shopOrderAfterMapper.insertShopOrderAfter(shopOrderAfter);
    }

    /**
     * 修改售后订单
     * 
     * @param shopOrderAfter 售后订单
     * @return 结果
     */
    @Override
    public int updateShopOrderAfter(ShopOrderAfter shopOrderAfter)
    {
        shopOrderAfter.setUpdateTime(DateUtils.getNowTimeSecond());
        return shopOrderAfterMapper.updateShopOrderAfter(shopOrderAfter);
    }

    /**
     * 批量删除售后订单
     * 
     * @param ids 需要删除的售后订单主键
     * @return 结果
     */
    @Override
    public int deleteShopOrderAfterByIds(Long[] ids)
    {
        return shopOrderAfterMapper.deleteShopOrderAfterByIds(ids);
    }

    /**
     * 删除售后订单信息
     * 
     * @param id 售后订单主键
     * @return 结果
     */
    @Override
    public int deleteShopOrderAfterById(Long id)
    {
        return shopOrderAfterMapper.deleteShopOrderAfterById(id);
    }
}
